import { createStore } from 'vuex';
import user from "./modules/user.js"

const store = createStore({
    state:()=>{
        return {
            nums: [23, 34, 56]
        }
    },
    getters:{
        sum: (state)=>{
            return state.nums.reduce((prev,val)=>prev+val,0)
        }
    },
    mutations:{
        change_nums(state, val){
            state.nums.push(val);
        }
    },
    modules:{
        user
    }
})

export default store;